package com.itheima.test4;

import java.util.Scanner;

public class CarTest {
    public static void main(String[] args) {
        Car[] cars = new Car[3];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            System.out.println("请输入品牌名称：");
            String brand = sc.next();
            System.out.println("请输入汽车价格：");
            int price = sc.nextInt();
            System.out.println("请输入汽车颜色：");
            String color = sc.next();
            Car car = new Car(brand, price, color);
            cars[i] = car;
        }

        for (Car car : cars) {
            System.out.println(car.getBrand() + ", " + car.getPrice() + ", " + car.getColor());
        }
    }
}
